import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";

var _class, _temp;

import React from "react";
import intl from "cpaas-front/lib/utils/intl";
import { BlockContainer } from "./index.style";
import SectionTitle from "../_components/SectionTitle";
import ConfigItem from "../_components/ConfigItem";
import withFormOperate from "../_components/withFormOperate";
import { getMemoizedAssets } from "./util";

var StepsConfig = withFormOperate(_class = (_temp = /*#__PURE__*/function (_React$Component) {
  _inherits(StepsConfig, _React$Component);

  function StepsConfig() {
    var _getPrototypeOf2;

    var _this;

    _classCallCheck(this, StepsConfig);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(StepsConfig)).call.apply(_getPrototypeOf2, [this].concat(args)));
    _this.getSteps = getMemoizedAssets(_this.props.styleCounts.steps, "steps");
    return _this;
  }

  _createClass(StepsConfig, [{
    key: "render",
    // getSteps = getStaticGif(this.props.styleCounts.steps, "steps", "svg");
    value: function render() {
      var _this$props = this.props,
          value = _this$props.value,
          handleChange = _this$props.handleChange,
          schema = _this$props.schema;
      return React.createElement(BlockContainer, {
        id: "prompt-config"
      }, React.createElement(SectionTitle, {
        title: "\u6B65\u9AA4\u6761",
        titleTail: "Steps"
      }), React.createElement(ConfigItem, {
        cols: 2,
        title: intl.get("cpaas.cpaasTheme.components.steps").d("步骤条"),
        items: this.getSteps(schema),
        defaultSelected: value,
        onChange: handleChange("style")
      }));
    }
  }]);

  return StepsConfig;
}(React.Component), _temp)) || _class;

export { StepsConfig as default };
